Class sbktech.tools.hashjava.bytecode.ClassInfo
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sbktech.tools.hashjava.bytecode.ClassInfo

java.lang.Object
   |
   +----sbktech.tools.hashjava.bytecode.ClassInfo

public class ClassInfo
extends Object
implements VMConstants, Modifiable
The ClassInfo is the basic informational unit about a single class. Once a class is read in, all information about it is stored, manipulated and written out here.

ClassInfo is handed to the Obfuscator interface as a way to obtain information about symbols defined in a Class file, and also provide means to rename these symbols.

Author:
$Author: kbs $
See Also:
obfuscate

Method Index

 o addAttribute(String, byte[])
This adds a named attribute into a Class file.
 o affects(Method)
 o definedFields()
This returns the set of fields defined in the class, and this is the only set that should be altered.
 o definedMethods()
This returns the set of methods defined in the class, and this is the only set that should be altered.
 o isInnerClass()
 o newInnerName()
 o newName()
 o originalName()
 o parentScope()
 o permissions()
Access permissions for this class
 o rename(String)
Set a new name for this class.
 o toString()

Methods

 o definedFields
  public Modifiable[] definedFields()
This returns the set of fields defined in the class, and this is the only set that should be altered.
Returns:
an array of Modifiables that represent the fields defined in this class
 o definedMethods
  public Method[] definedMethods()
This returns the set of methods defined in the class, and this is the only set that should be altered. Overridden methods, or methods implemented from interfaces are not considered to be defined in the class.
Returns:
an array of Methods which represent the methods defined in this class
 o affects
  public Hashtable affects(Method m)
Parameters:
m - is the method for which a dependency list is desired
Returns:
a Hashtable of ClassInfo entries. The Hashtable is just a set of all classes which will have a method renamed if method m in this class is renamed. It will always return null if this class is not an interface.
 o addAttribute
  public void addAttribute(String name,
                           byte data[])
This adds a named attribute into a Class file. It is just a way to embed arbitrary data into a class file. You can use this for instance, to store copyright strings or versioning information directly in the bytecode.
Parameters:
name - Name for the attribute
data - bytes containing the data to be associated with the name
 o permissions
  public int permissions()
Access permissions for this class
Returns:
an integer (see values in VMConstants) describing the access permissions for this class
See Also:
VMConstants
 o originalName
  public String originalName()
Returns:
the name for the class
 o newName
  public String newName()
Returns:
the new (possibly renamed) name for this class
 o isInnerClass
  public boolean isInnerClass()
Returns:
true if this class is an inner class
 o parentScope
  public String parentScope()
Returns:
the name of the containing class scope if this is an inner class
 o newInnerName
  public String newInnerName()
Returns:
the name of this inner class. This can be null or 0 length if the class is not an inner class, or if the class is anonymous.
 o rename
  public void rename(String n)
Set a new name for this class. If this is an inner class, this only renames the "inner" name.
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index